package com.yuan.dingtalk.service;

import com.dingtalk.api.response.OapiGettokenResponse;
import com.taobao.api.ApiException;
import com.yuan.dingtalk.vo.UserInfo;

public interface IDingtalkService {

    /**
     * 获取钉钉access_token
     * @param appKey
     * @param appSecret
     * @return
     * @throws ApiException
     */
    String getCacheAccessToken(String appKey, String appSecret) throws ApiException;

    /**
     * 获取userId
     * @param access_token 调用接口凭证
     * @param code 免登授权码，参考上述“获取免登授权码”
     * @return
     */
    String getUserId(String access_token, String code) throws ApiException;

    /**
     *
     * @param access_token 调用接口凭证
     * @param userid 员工id
     * @param lang 通讯录语言(默认zh_CN，未来会支持en_US)
     * @return
     */
    UserInfo getUserInfo(String access_token, String userid, String lang) throws ApiException;

    /**
     *
     * @param appKey
     * @param appSecret
     * @param code 免登授权码，参考上述“获取免登授权码”
     * @param lang 通讯录语言(默认zh_CN，未来会支持en_US)
     * @return
     * @throws ApiException
     */
    UserInfo getUserInfo(String appKey, String appSecret, String code, String lang) throws ApiException;
    /**
     * 获取原生access_token
      * @param appKey
     * @param appSecret
     * @return
     * @throws ApiException
     */
    OapiGettokenResponse getPrototypeTokenResponse(String appKey, String appSecret) throws ApiException;

    /**
     * 获取原生access_token
     * @param appKey
     * @param appSecret
     * @return
     * @throws ApiException
     */
    String getPrototypeAccessToken(String appKey, String appSecret) throws ApiException;

}
